<%@ page pageEncoding="UTF-8"%>
<%@ include file="/components/message/category.jsp"%>
<script type="text/x-template" id="tag_add_member">
    <div class="_message_send_origin">
        <div class="_pop-container">
            <div class="_top">
                新增成员
            </div>
            <div class="_search-bg">
                <div class="_search-container" @click="fuzzyFocus()">
                    <div class="_dept-choosed" v-for="dept in choosedDeptList">
                        <span v-html="dept.deptName"></span>
                        <div class="_delete-choosed" @click="removeDept(dept)"></div>
                    </div>
                    <div class="_person-choosed" v-for="person in choosedPersonList">
                        <span v-html="person.name"></span>
                        <div class="_delete-choosed" @click="personCheckChange(person)"></div>
                    </div>
                    <input class="_fast-search" type="text" placeholder="可搜索" @input="searchBlur($event)" @focus="showSearch()" @blur="hideSearch()">
                </div>
                <div class="_fuzzy" v-show="searchInputShow">
                    <div class="person" v-show="showSearchResult('user')">
                        <div class="person-depart-tag">人员</div>
                        <div class="people" v-for="user in searchResult.user" @click="searchChoosed(user, 'user')">
                            <img class="show-block person-img" src="../../images/palace/message/avator-female.png">
                            <div class="show-block result-info" v-html="user.name"></div>
                        </div>
                    </div>
                    <div class="person" v-show="showSearchResult('dept')">
                        <div class="person-depart-tag">部门</div>
                        <div class="people" v-for="dept in searchResult.dept" @click="searchChoosed(dept, 'dept')">
                            <img class="show-block person-img" src="../../images/palace/address/ic-file2.png">
                            <div class="show-block result-info" v-html="dept.deptName">彭勇</div>
                        </div>
                    </div>
                    <div class="person" v-show="showSearchResult('label')">
                        <div class="person-depart-tag">标签</div>
                        <div class="people" v-for="label in searchResult.label" @click="searchChoosed(label, 'label')">
                            <img class="show-block person-img" src="../../images/palace/address/ic-label2.png">
                            <div class="show-block result-info" v-html="label.name">彭勇</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="_container">
                <div class="_dept">
                    <div class="_dept-title" @click="deptQuery()">
                        <span>市立医院</span>
                    </div>
                    <div class="_dept-container">
                        <deptcategory :list="deptList" :parent="all"></deptcategory>
                    </div>
                </div>
                <div class="_man">
                    <div class="_man-each" v-for="person in personList" @click="personCheckChange(person)">
                        <div class="_checkbox">
                            <img src="/images/components/add_member/check-box-s.png" alt="" v-show="personCheck(person)">
                            <img src="/images/components/add_member/check-box.png" alt="" v-show="!personCheck(person)">
                        </div>
                        <img class="_man-default" :src="person.avatar" alt="">
                        <span>{{person.name}}</span>
                    </div>
                </div>
            </div>
            <div class="_footer">
                <div class="_submit" @click="submit()">
                    确定
                </div>
            </div>
            <img class="_close" src="/images/components/add_member/ic-close.png" alt="" @click="closeAddMember()">
        </div>
    </div>
</script>
<link rel="stylesheet" href="/css/components/send_origin.css"/>
<script>
    var HOSPITAL = "${user.hospital}";
</script>
<script src="/components/tag/add_member.js"></script>